package com.iupon.tools.springevent.listener;

import com.iupon.tools.springevent.entity.RequestVO;
import com.iupon.tools.springevent.service.PlayerOnLoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ApplicationReadyEventListener implements ApplicationListener<ApplicationReadyEvent> {
    @Autowired
    PlayerOnLoginService playerOnLoginService;
    @Override
    public void onApplicationEvent(ApplicationReadyEvent event) {
        log.info("......ApplicationReadyEvent......");
        log.info("开始测试");
        RequestVO requestVO = new RequestVO();
        requestVO.setPid("xiaowugege");
        playerOnLoginService.initPlayerInfo(requestVO);
        log.info("结束测试");
    }

}
